<template>
  <div class="app-container">
    标题
    <el-input v-model="title" placeholder="请输入内容" ></el-input>收件人账号
    <el-input v-model="receiver" placeholder="请输入内容" ></el-input>内容
    <el-input v-model="body" placeholder="请输入内容" ></el-input>
    <el-button type="primary" @click="send()">发送</el-button>
  </div>
</template>

<script>
import { sendMsg } from "@/api/msg";
export default {
  data() {
    return {
      title: "",
      receiver: "",
      body: ""
    };
  },
  methods: {
    send() {
      let li = [];
      li.push(this.receiver);
      let data = {};
      data.body = this.body;
      data.receiver = li;
      data.title = this.title;
      console.log(data);
      sendMsg(data).then(response => {
        console.log(response);
        this.title=""
        this.body =""
      });
    }
  }
};
</script>